http-client-java, support apiVersions property in metadata.json#9725
Draft
weidongxu-microsoft wants to merge 7 commits intomicrosoft:mainfrom
Draft
http-client-java, support apiVersions property in metadata.json#9725weidongxu-microsoft wants to merge 7 commits intomicrosoft:mainfrom
weidongxu-microsoft wants to merge 7 commits intomicrosoft:mainfrom
Conversation
Contributor
|
All changed packages have been documented.
|
13ae3c4 to
aec86f9
Compare
commit: |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds support for the apiVersions property in metadata.json, transitioning from a single apiVersion string to a map of TypeSpec namespace to API version. This change enables support for services that use multiple API versions across different namespaces, as mentioned in the linked issue.
Changes:
- Changed metadata.json schema from single
apiVersionstring toapiVersionsmap (namespace → version) - Removed deprecated apiview_properties.json file generation
- Updated FluentProject to handle multiple API versions in service descriptions
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| MetadataUtil.java | Removed unused getLatestApiVersionFromClient method that is no longer needed |
| TypeSpecFluentPlugin.java | Updated to pass apiVersionMap instead of single apiVersion to methods |
| TypeSpecPlugin.java | Updated to pass codeModel.getApiVersionMap() to metadata constructor |
| FluentProject.java | Enhanced to format service description with single or multiple API versions |
| FluentGen.java | Updated method signature to accept Map<String, String> for API versions |
| JavaPackage.java | Removed deprecated apiview_properties.json generation code |
| TypeSpecMetadata.java | Changed from single apiVersion field to apiVersions map with updated JSON serialization |
| Client.java | Added apiVersionMap field (LinkedHashMap) to store namespace-to-version mappings |
| code-model.ts | Added optional apiVersionMap field to CodeModel interface |
| client.ts | Updated comment clarifying serviceVersion is for ServiceVersion class |
| code-model-builder.ts | Added code to populate apiVersionMap from TCGC metadata |
| http-client-java_update-metadata-file-2026-1-14-14-41-22.md | Added changelog entry for the feature |
...va/com/microsoft/typespec/http/client/generator/core/model/clientmodel/TypeSpecMetadata.java
Show resolved
Hide resolved
Collaborator
|
You can try these changes here
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix Azure/autorest.java#3265
Sample
Also affect pom.xml and other md file.
E.g. for mixed version, description will now be
instead of
apiview JSON file is no longer generated